#pragma once

#include "stdafx.h"

class Console
{
public:
	Console(void);
	~Console(void);
	void setTracking(char *distance){options.tracking = true; options.distance = atof(distance);}
	void setServer(char *server){options.server = server;}
	void setGuild(char *guild){options.guild = guild;}
	void setUser(char *user){options.user = user;}
	void setChannel(char *channel){options.channel = channel;}
	void setCharacter(char *character){options.character = character;}
	void setProfession(char *prof){options.profession = prof;}
	void setInterval(char *interval){options.interval = atoi(interval);}
	void setIp(char *ip){options.ip = ip;}
	void setPort(char *port){options.port = atoi(port);}
	void setDelChar(char *name){options.delChar = name;}
	int load();
	int loadOld();
	int save(struct userData *data=0);
	struct opt* getOptions(){return &options;}
	int interrupt(int signal){printf_s("user interrupt, CODE %d (SIGINT)\n", signal); run = false; return 0;}
	int exec();
	int reset();
	int update();
	int getVersion(){return VERSION;}
	
private:
	Position *pos;
	Connection con;
	guildPtr guild;
	struct opt options;
	bool run, predefData, sock;
	char path[MAX_PATH];
	void initPath();
};

